From: kfraser@localhost.localdomain Date: Fri, 28 Jul 2006 16:13:08 +0000 (+0100) Subject: [NET] front: Added feature-rx-notify X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15772 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d5dd60406fa35f8cb7335d664dc6d4bce14698e6;p=xen.git [NET] front: Added feature-rx-notify This patch adds support to the frontend for notifying the backend whenever the rx ring is refilled. This is required in order for the backend to get a tx queue. Signed-off-by: Herbert Xu Modified to only send notification if req_event index is set appropriately. Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 77921f081d..2bfd63acd8 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -326,6 +326,12 @@ again: goto abort_transaction; } + err = xenbus_printf(xbt, dev->nodename, "feature-rx-notify", "%d", 1); + if (err) { + message = "writing feature-rx-notify"; + goto abort_transaction; + } + err = xenbus_transaction_end(xbt, 0); if (err) { if (err == -EAGAIN) @@ -569,7 +575,7 @@ static void network_alloc_rx_buffers(struct net_device *dev) unsigned short id; struct netfront_info *np = netdev_priv(dev); struct sk_buff *skb; - int i, batch_target; + int i, batch_target, notify; RING_IDX req_prod = np->rx.req_prod_pvt; struct xen_memory_reservation reservation; grant_ref_t ref; @@ -682,7 +688,9 @@ static void network_alloc_rx_buffers(struct net_device *dev) /* Above is a suitable barrier to ensure backend will see requests. */ np->rx.req_prod_pvt = req_prod + i; push: - RING_PUSH_REQUESTS(&np->rx); + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&np->rx, notify); + if (notify) + notify_remote_via_irq(np->irq); } static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev, diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h index 7b219b00a2..b551006034 100644 --- a/xen/include/public/io/netif.h +++ b/xen/include/public/io/netif.h @@ -13,10 +13,11 @@ #include "../grant_table.h" /* - * Note that there is *never* any need to notify the backend when - * enqueuing receive requests (struct netif_rx_request). Notifications - * after enqueuing any other type of message should be conditional on + * Notifications after enqueuing any type of message should be conditional on * the appropriate req_event or rsp_event field in the shared ring. + * If the client sends notification for rx requests then it should specify + * feature 'feature-rx-notify' via xenbus. Otherwise the backend will assume + * that it cannot safely queue packets (as it may not be kicked to send them). */ /*